<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <form class="form-horizontal" id="form" method="post" action="{:U('update')}">

                            <!-- PAGE CONTENT BEGINS -->

                            <input type="hidden" name="id" value="{$article.id}" id="id"/>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="kh_name">
                                    客户名称 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="kh_name" id="kh_name" placeholder="客户名称"
                                           class="col-xs-10 col-sm-5" value="{$article['kh_name']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">客户名称不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="dk_desc">
                                    贷款描述 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="dk_desc" id="dk_desc" placeholder="贷款描述"
                                           class="col-xs-10 col-sm-5" value="{$article['dk_desc']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">贷款描述不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="kh_desc">
                                    客户条件描述 </label>
                                <div class="col-sm-9">
                                    <textarea type="text" name="kh_desc" id="kh_desc" placeholder="客户条件描述"
                                              class="col-xs-10 col-sm-5" rows="3" >{$article['kh_desc']}</textarea>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="ziliao">
                                    资料情况描述 </label>
                                <div class="col-sm-9">
                                    <textarea name="ziliao" id="ziliao" placeholder="资料情况描述"
                                              class="col-xs-10 col-sm-5" rows="5">{$article['ziliao']}</textarea>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">资料情况描述。</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="anli_desc">
                                    案例描述 </label>
                                <div class="col-sm-9">
                                    <textarea name="anli_desc" id="anli_desc" placeholder="案例描述"
                                              class="col-xs-10 col-sm-5" rows="5">{$article['anli_desc']}</textarea>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="adviser_id">
                                    所属顾问 </label>
                                <div class="col-sm-9">
                                    <select id="adviser_id" name="adviser_id" class="col-xs-10 col-sm-5 select2">
                                        <foreach item="adviser" name="list" key="k">
                                            <option value="{$adviser.id}" <if condition="$article['adviser_id'] eq $adviser.id">selected="selected"</if> >{$adviser.name}</option>
                                        </foreach>
                                    </select>
                                </div>
                            </div>


                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>

                            <!-- PAGE CONTENT ENDS -->


                        </form>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        $(".submit").click(function () {
            var kh_name = $("#kh_name").val();
            var anli_desc = $("#anli_desc").val();
            if (kh_name == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "客户名称必须选择。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (anli_desc == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "案例描述需要填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            $("#form").submit();
        });
    });
</script>
</body>
</html>
